import request from '@/utils/request'

// 获取优惠活动列表
export function getPromotionAdList(params) {
  return request({
    url: '/life/PromotionAd/list',
    method: 'get',
    params
  })
}

// 获取优惠活动详情
export function getPromotionAdDetail(id) {
  return request({
    url: `/life/PromotionAd/${id}`,
    method: 'get'
  })
}

// 新增优惠活动
export function addPromotionAd(data) {
  return request({
    url: '/life/PromotionAd',
    method: 'post',
    data
  })
}

// 修改优惠活动
export function updatePromotionAd(data) {
  return request({
    url: '/life/PromotionAd',
    method: 'put',
    data
  })
}

// 删除优惠活动
export function deletePromotionAd(ids) {
  return request({
    url: `/life/PromotionAd/${ids}`,
    method: 'delete'
  })
}

// 导出优惠活动
export function exportPromotionAd(params) {
  return request({
    url: '/life/PromotionAd/export',
    method: 'post',
    data: params
  })
}
